package com.taomeishu.mailcrazy.checkers;

import com.taomeishu.mailcrazy.AbstractMailExistChecker;
import com.taomeishu.mailcrazy.checkers.sina.SinaResultParser;
import com.taomeishu.mailcrazy.parser.ResultParser;

public class SinaMailExistChecker extends AbstractMailExistChecker {

	// https://login.sina.com.cn/signup/check_user.php
	
	private ResultParser resultParser = new SinaResultParser();
	
	@Override
	protected String makeRequestUrl(String username, String domainName) {
		return "https://login.sina.com.cn/signup/check_user.php";
	}

	@Override
	protected ResultParser getResultParser() {
		return resultParser;
	}

	@Override
	protected boolean usePostMethod() {
		return true;
	}

	@Override
	protected byte[] getPostData(String username, String domainName) {
		String s = "from=regmail&name="+ username +"&timeStamp=" + System.currentTimeMillis();
		return s.getBytes();
	}

	@Override
	protected String getReferer() {
		return "https://login.sina.com.cn/signup/signup.php?entry=freemail";
	}

}
